Diesel fuel consumption cannot be calculated in the simple way that gasoline fuel consumption can, because the air-fuel ration is not constant. Most current methods need to access proprietary information on fuel injector dwell times which is rarely easily available.
Also, the most convenient parameter with which to calculate gasoline fuel flow is MAF (mass airflow or, according to SAE J1979 PID 1-10). But a significant minority of passenger vehicles do not report MAF.